//
// Created by A on 2018/7/4.
//

#ifndef MEMCHECKER_MEMCHECKER_H
#define MEMCHECKER_MEMCHECKER_H


#include <stdlib.h>
#include <memory.h>
#include <stdio.h>

#ifdef __cplusplus
extern "C" {
#endif

//声明自定义malloc及free函数
extern void *inner_malloc(unsigned int uSize, const char* filePath,const char *pszFunc, unsigned int uLine);
extern void inner_free(void *pPtr, const char* filePath, const char *pszFunc, unsigned int uLine);


#define Malloc(size) inner_malloc(size , __FILE__ , __FUNCTION__ , __LINE__)
#define Free(ptr)    inner_free(ptr , __FILE__ , __FUNCTION__ , __LINE__)


void memChecker_init();

void memChecker_printAllMemUsage();

void memChecker_printLeakMem();

void memChecker_dumpAllMemUsage(char *filePath);

void memChecker_dumpLeakMem(char *filePath);

void memChecker_release();

#ifdef __cplusplus
}
#endif
#endif //MEMCHECKER_MEMCHECKER_H
